#!/bin/bash

#calculate sum of numbers of input . 
#if input 0 calculate result
#float ignore
sum=0
while read -p "input number:" data
do
    #if ! expr 1 + $data &> /dev/null
    
   # expr 1 + $data &>/dev/null
    #if(($?>1))
    num=`expr "$data" : '[0-9]*'`
    if((num!=${#data}))
    then
    	echo "not integer!"
        continue
    fi

    if((data==0))
    then
    	break
    fi

    sum=$[sum+data]
done
echo "sum=$sum"
